<?php
$sql = "SELECT TempImage1,Item,a.Id,Description FROM ".$base_obj->CLASSIFIEDS_ADS." a
		INNER JOIN ".$base_obj->CLASSIFIEDS_SUB_CAT." b	ON (a.sub_category = b.id AND b.active_status='1')
		INNER JOIN ".$base_obj->CLASSIFIEDS_CAT." c	ON (a.category = c.id AND c.active_status='1')
		WHERE sub_category='".$cat_id."' AND a.Status = '1'"; 
$res = $base_obj->exec_query($sql);
$data = $base_obj->fetch_row_all($res);

?>
<div class="contentwarp" style="min-height:1000px;">
      <!-- Begin contentwarpLeft -->
      <!-- End contentwarpLeft -->
      <!-- Begin contentwarpMiddle -->
      <div class="contentwarpMiddle">
         
        <div id="inner_content" class="clearfix cbb" style="border:0;">
        <h1 class="titles" style="text-transform:uppercase; margin-top:20px; padding-left:10px;"><?php echo $base_obj->getClassifieidsSubCategoryName($cat_id)?></h1>
        <div class="ads premium">
  <ul>
    <li class="odd"><span class="ad">
      <div style="float:left; width:950px;">
	  <?php
	for($i=0;$i<count($data);$i++) {
		$image = 'uploads/adimages/'.$data[$i]['TempImage1'];
		list($img_width,$img_height,$file) = @getimagesize($image);
				
		if((file_exists($image) and ($img_width == 0 or $img_height == 0)) or !file_exists($image)) {
			$image = 'images/noimage.jpg';
		}

	?>	<div style="float:left; width:450px; margin:5px 5px 5px 5px;">
    	<div style="padding:3px 3px 3px 3px;" class="borders">
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td width="29%" rowspan="3" align="center" valign="top" class="ad_default_image ad_listing_image">
            <img style="width:100px;" src="thumb.php?file=<?php echo $image;?>&sizex=180&sizey=130"></td>
            <td width="71%" class="ad_default_listing"><b>
            <a href="index.php?page=classifieds&view=ad&cat_id=<?php echo $data[$i]['Id']?>" target="_top"><?php echo $data[$i]['Item'];?></a></b>
            </td>
          </tr>
          <tr>
            <td class="font12"><?php echo $data[$i]['Description'];?></td>
          </tr>
          <tr>
            <td class="font12">&nbsp;</td>
          </tr>
        </tbody>
      </table></div></div>
      <?php } ?></div>
      </span></li>
      
  </ul>
</div>  
        </div>
      </div>
      <!-- End contentwarpMiddle -->
      <?php include("includes/right_content.php");?>
      <!-- End contentwarp -->
    </div>
